package taskcards;

public class HTML {
	String  Title, Head, Body, Footer;

	public HTML() {
		
		Title = "<!DOCTYPE html>" + "\n" + "<html>\n";
				//+ "<html manifest=\"cache.appcache\">\n";
		Head = "";
		Body = "";
		Footer = "</html>";

	}

	public void createHead(String title) {

		this.Head = "<head>\n\t\t"
				+ "<title>"
				+ title
				+ "</title>\n\t\t"
				+ "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n\t\t"
				+ "<meta name=\"viewport\" content=\"user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0\"/>\n\t\t"
				+ "  <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n\t\t"
				+ "<link rel=\"apple-touch-icon\" href=\"icon.png\"/>\n\n\t\t"
				+ "<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" />\n\t\t"
				+ "<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />\n\t\t"
				+ "<script type=\"text/javascript\" src=\"script.js\"></script>\n"
				+ "</head>\n\n";
	}

	public void createBody(String name, String image) {
		String firstName, lastName;
		firstName = "John";
		lastName = "Doe";

		String Name[] = name.split("\\s+");
		if (Name.length >= 1) {
			firstName = Name[0];
		}
		if (Name.length>= 2) {
			lastName = Name[1];
		}

		this.Body = "<body onload=\"display(0);\">\n\t\t"
				+ "<div id=\"page\">\n\t\t"
				+ "<div id=\"name\">"
				+ firstName
				+ "<br />"
				+ lastName
				+ "</div>\n\t\t"
				+ "<div id=\"profilePicture\"><img id=\"piccy\" src=\""
				+ image
				+ "\" id=\"profilePic\" alt=\"This will be a profile picture for the person\" /></div>\n\t\t"
				+ "<div id=\"title\"></div>\n\t\t"
				+ "<div id=\"prev\"><img src=\"prev.png\" alt=\"Previous\" onclick=\"display(currentContent-1);\" /></div>\n\t\t"
				+ "<div id=\"home\"><img src=\"HOUSE.png\" alt=\"Home\" onclick=\"display(0);\" /></div>\n\t\t"
				+ "<div id=\"next\"><img src=\"next.png\" alt=\"Next\" onclick=\"display(currentContent+1);\" /></div>\n\t\t"
				+ "<div id=\"main\"></div>\n\t</div>\n" + "</body>\n";

	}

	public String toString() {
		String s =  Title + Head + Body + Footer;
		return s;

	}

}
